package generic2;

public class classAndfun1 {

    public static void main(String[] args) {
        Fruit<String> str = new Fruit<>("eggplant");
        String xixi = str.xixi(12);
        System.out.println(xixi);
    }

}

class Fruit<T>{

    private T category;

    public T getCategory() {
        return category;
    }

    public void setCategory(T category) {
        this.category = category;
    }

    public Fruit(T category) {
        this.category = category;
    }
    public <E> T xixi(E p){
        System.out.println(p.getClass().getName());
        return category;
    }
}
